package com.cppsu.cgx.libraryseatselection.dao;

import com.cppsu.cgx.libraryseatselection.dto.SeatSelectionDetails;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;

import java.util.List;

/**
 * @Author: guibo
 * @Description:
 * @Date: Created in 17:17 2021/3/14
 * @Modified By:
 */
@Mapper
public interface SeatSelectionDao {

    @SelectProvider(type= SqlProviderAdapter.class, method="select")
    @Results(id="SeatSelectionDetails", value={
            @Result(column="id", property="id", id=true),
            @Result(column="start", property="start"),
            @Result(column="end", property="end"),
            @Result(column="number", property="number"),
            @Result(column="library_name", property="libraryName"),
            @Result(column="floor_number", property="floorNumber")
    })
    List<SeatSelectionDetails> listSeatSelectionDetails(SelectStatementProvider selectStatement);
}
